package com.cyj.dream.admin.contacts.enums;

import com.cyj.dream.core.util.IsEmptyUtils;

/**
 * @Description: 删除操作记录的日期阶段枚举类
 * @BelongsProject: dream-DreamChardonnay
 * @BelongsPackage: com.dream.DreamChardonnay.constant.enums
 * @Author: ChenYongJia
 * @CreateTime: 2021-06-21 11:29
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
public enum DeleteLogDateEnum {

    /**
     * 枚举参数
     */
    DELETE_MONTH(0, "删除本月之前的所有操作记录"),
    DELETE_WEEKS(1, "删除本周之前的所有操作记录"),
    DELETE_TODAY(2, "删除今天之前的所有操作记录员"),;

    private Integer code;
    private String message;

    DeleteLogDateEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据 类型编码 来获取 描述信息
     * @param code
     * @return
     */
    public static String getMessByCode(Integer code) {
        if (IsEmptyUtils.isEmpty(code)) {
            return null;
        }

        for (DeleteLogDateEnum deleteLogDateEnum : values()) {
            if (deleteLogDateEnum.getCode().equals(code)) {
                return deleteLogDateEnum.getMessage();
            }
        }
        throw new RuntimeException("没有找到对应的描述信息");
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static void main(String[] args) {
        System.out.println(DeleteLogDateEnum.DELETE_MONTH);
    }

}
